//
//  ZJMessageEarlyTableViewCell.m
//  ZJControlsClass
//
//  Created by wandoufo on 2024/12/6.
//

#import "ZJMessageEarlyTableViewCell.h"
#import <Masonry/Masonry.h>

@implementation ZJMessageEarlyTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    self.nameLabel = [[UILabel alloc] init];
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    
    self.scoreLabel = [[UILabel alloc] init];
    self.scoreLabel.textAlignment = NSTextAlignmentCenter;
    
    self.departmentLabel = [[UILabel alloc] init];
    self.departmentLabel.textAlignment = NSTextAlignmentCenter;
    
    [self.contentView addSubview:self.nameLabel];
    [self.contentView addSubview:self.scoreLabel];
    [self.contentView addSubview:self.departmentLabel];
    
    // 添加底部分割线
    UIView *lineView = [[UIView alloc] init];
    lineView.backgroundColor = [UIColor colorWithHexString:@"#EBEEF5"];
    [self.contentView addSubview:lineView];
    
    // 布局
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView);
        make.centerY.equalTo(self.contentView);
        make.width.equalTo(self.contentView.mas_width).multipliedBy(0.3);
    }];
    
    [self.scoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.contentView);
        make.width.equalTo(self.contentView.mas_width).multipliedBy(0.3);
    }];
    
    [self.departmentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView);
        make.centerY.equalTo(self.contentView);
        make.width.equalTo(self.contentView.mas_width).multipliedBy(0.3);
    }];
    
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.contentView);
        make.height.mas_equalTo(0.5);
    }];
}

@end
